/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package xmlparser;

import java.io.File;
import java.util.Collection;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import syntax.Clock;
import syntax.ClockGuard;
import syntax.Input;
import syntax.Location;
import syntax.Message;
import syntax.Operator;
import syntax.Output;
import syntax.Repository;
import syntax.TIOA;
import syntax.Transition;

/**
 *
 * @author ennouaary
 */
public class XMLParserTest {

    File file;

    public XMLParserTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
        file = new File("C:\\Users\\ennouaary\\Documents\\NetBeansProjects\\TIOA\\verif-and-validation-tool\\TIOA-Shared\\src\\resources\\systemTIOA.xml");
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of getLocation method, of class XMLParser.
     */
//    @Test
    public void testGetLocation() throws Exception {
        System.out.println("getLocation");
        String name = "";
        Repository repository = null;
        XMLParser instance = null;
        Location expResult = null;
        Location result = instance.getLocation(name, repository);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of getClock method, of class XMLParser.
     */
//    @Test
    public void testGetClock() throws Exception {
        System.out.println("getClock");
        String name = "";
        Repository repository = null;
        XMLParser instance = null;
        Clock expResult = null;
        Clock result = instance.getClock(name, repository);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of getMessage method, of class XMLParser.
     */
//    @Test
    public void testGetMessage() throws Exception {
        System.out.println("getMessage");
        String name = "";
        Repository repository = null;
        XMLParser instance = null;
        Message expResult = null;
        Message result = instance.getMessage(name, repository);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of addLocation method, of class XMLParser.
     */
//    @Test
    public void testAddLocation() throws Exception {
        System.out.println("addLocation");
        String name = "l0";
        Repository repository = Repository.getInstance();
        XMLParser instance = new XMLParser(file);
        Location result = instance.addLocation(name, repository);
        Location expResult = repository.getLocation("l0");
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        if (expResult != result) {
            fail("The test case is a prototype.");
        }
    }

    /**
     * Test of addClock method, of class XMLParser.
     */
//    @Test
    public void testAddClock() throws Exception {
        System.out.println("addClock");
        String name = "";
        Float l_b = null;
        Float u_b = null;
        Repository repository = null;
        XMLParser instance = null;
        Clock expResult = null;
        Clock result = instance.addClock(name, l_b, u_b, repository);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of addMessage method, of class XMLParser.
     */
//    @Test
    public void testAddMessage() throws Exception {
        System.out.println("addMessage");
        String name = "";
        String messageType = "";
        Repository repository = null;
        XMLParser instance = null;
        Message expResult = null;
        Message result = instance.addMessage(name, messageType, repository);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of addTransition method, of class XMLParser.
     */
//    @Test
    public void testAddTransition() throws Exception {
        System.out.println("addTransition");
        String name = "";
        Location src = null;
        Location dest = null;
        Message message = null;
        Collection<Clock> resetClocks = null;
        ClockGuard clockGuard = null;
        Repository repository = null;
        XMLParser instance = null;
        Transition expResult = null;
        Transition result = instance.addTransition(name, src, dest, message, resetClocks, clockGuard, repository);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of parseOperator method, of class XMLParser.
     */
//    @Test
    public void testParseOperator() {
        System.out.println("parseOperator");
        String xmlValue = "LE";
        XMLParser instance = new XMLParser(file);
        Operator.Op expResult = Operator.Op.LE;
        Operator.Op result = instance.parseOperator(xmlValue);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        if (expResult != result) {
            fail("The test case is a prototype.");
        }
    }

    /**
     * Test of parse method, of class XMLParser.
     */
    //@Test
    public void testParse() throws Exception {
        System.out.println("parse");
        XMLParser instance = new XMLParser(file);
        TIOA tioa = instance.parse();
        System.out.print(tioa.printTIOA());
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }

    /**
     * Test of parse method, of class XMLParser.
     */
    @Test
    public void testTioaToXml() throws Exception {
        System.out.println("tioaToXml");
        XMLParser instance = new XMLParser(file);
        TIOA tioa = instance.parse();
        System.out.print(instance.tioaToXml(tioa));
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }
    
    /**
     * Test of main method, of class XMLParser.
     */
//    @Test
    public void testMain() {
        System.out.println("main");
        String[] args = null;
        XMLParser.main(args);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of parseOperator method, of class XMLParser.
     */
    //@Test
    public void testParseOperator_String() {
        System.out.println("parseOperator");
        String xmlValue = "LE";
        XMLParser instance = new XMLParser(file);
        Operator.Op expResult = Operator.Op.LE;
        Operator.Op result = instance.parseOperator(xmlValue);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        
        //fail("The test case is a prototype.");
    }

    /**
     * Test of parseOperator method, of class XMLParser.
     */
    //@Test
    public void testParseOperator_OperatorOp() {
        System.out.println("parseOperator");
        Operator.Op op = Operator.Op.EQ;
        XMLParser instance = new XMLParser(file);
        String expResult = "LT";
        String result = instance.parseOperator(op);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }

    /**
     * Test of parseMessageType method, of class XMLParser.
     */
    //@Test
    public void testParseMessageType() {
        System.out.println("parseMessageType");
        Message message = new Output("TEST");
        XMLParser instance = new XMLParser(file);
        String expResult = "OUTPUT";
        String result = instance.parseMessageType(message);
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
        //fail("The test case is a prototype.");
    }
}